﻿using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;

namespace SerilogLearn.ConsoleApp;

internal class Program
{
    static async Task Main(string[] args)
    {
        HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
        builder.Services.AddSerilog((services, loggerConfiguration) =>
        {
            loggerConfiguration.Enrich.FromLogContext();
            loggerConfiguration.ReadFrom.Configuration(builder.Configuration);
            //Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme.Literate
            //loggerConfiguration.WriteTo.Async(loggerSknkConfiguration =>
            //{
            //    loggerSknkConfiguration.Console();
            //});
        });
        builder.Services.AddHostedService<TestService>();
        IHost app = builder.Build();
        await app.RunAsync();
    }
}
